package com.atguigu.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

public class collectionDemo {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //todo 从集合读取数据
        DataStreamSource<Integer> source = env
//                .fromCollection(Arrays.asList(1, 22, 1131)) //从集合读
                .fromElements(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) //直接填写元素
                ;
        source.print();
        env.execute();
    }
}
